Skip to main content

Simulate Swap

Simulates a swap given the swap parameters.

Request URL

https://api.euclidprotocol.com/api/v1/simulate-swap

Curl

curl -X 'POST' \
'https://api.euclidprotocol.com/api/v1/simulate-swap' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"amount_in": "10",
"asset_in": "usdt",
"asset_out": "nibi",
"contract": "nibi1nsvx0s8kj2jn0smcrz4t0wga9dtrjkvsfd24ay5jrkw3jgrhjmeq8suvmz",
"min_amount_out": "1",
"swaps": ["usdt","nibi"]

}'

Parameters

Swap Transaction Details

FieldTypeDescription
amount_inStringThe amount of the asset being swapped in.
asset_inStringThe Id of the input asset.
asset_outStringThe Id of the output asset.
contractStringThe address of the router contract.
min_amount_outStringThe minimum amount of the output asset for the swap to be considered a success.
swapsArrayA list of swaps to execute to get from asset_in to asset_out.

Example Response

 {"data":{"amount_out":"10","asset_out":"nibi"}}